import {request} from '@/base/Request';
import qs from 'qs';

export class AuthAccessToken {
  // eslint-disable-next-line camelcase
  accessToken: string = '';
}

export function postAccessToken(email: string, password: string, clientId: string) {
  return request.post(AuthAccessToken, '/api/auth/account/access-token', qs.stringify({
    email,
    password,
    clientId
  }));
}
export function postAccessToken2(phone: string, password: string, clientId: string) {
  return request.post(AuthAccessToken, '/api/auth/agent/access-token', qs.stringify({
    phone,
    password,
    clientId
  }));
}
// export function getToken(phone: string, password: string) : Promise<Result<AuthApi>> {
//   return new Promise(function(resolve, reject){
//     const token = new AuthApi();
//     token.access_token='abc';
//     const result = new Result<AuthApi>("", "", token);
//     resolve(result);
//   })
// }
